<template>
    <view class="dai">
        <u-swiper v-show="flag" :list="list" :height="420" ></u-swiper>
        <myhead v-show="!flag" title="小城代驾" color="white" :background="headbg"  ></myhead>
        <view v-for="(l,i) in 10" :key="i" class="item">
            {{i}}
        </view>
    </view>
</template>

<script>
export default {
    data(){
        return {
            list:[  ],
            flag:true
        }
    },
    onLoad(){
        uni.showLoading({
            title:""
        })
        uni.request({
            url:"https://m.maizuo.com/gateway",
            method:"get",
            data:{
                type: 2,
                cityId: 110100,
                k: 6422732,
            },
            header:{
                'X-Host': 'mall.cfg.common-banner',
                'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.0","e":"164016685720306605375489","bc":"110100"}'
            },
            success:res=>{
                console.log(res)
                uni.hideLoading({})
                this.setbannersAction(res.data.data)
                this.list = res.data.data.map(item=>{
                    return {
                        image:item.imgUrl
                    }
                })
                console.log(this.list)
            }
        })
    },
    mounted(){

    },
    // 监听页面滑动
    onPageScroll(obj){
        // console.log(obj)
        if(obj.scrollTop>200){
            this.flag = false
        }else{
            this.flag = true 
        }
    }
}
</script>


<style lang="scss">
.dai{
    .item{
        width:100%;
        height:200rpx;
        background: pink;
    }
}
</style>